package c.c.a;

import android.annotation.TargetApi;
import android.text.TextUtils;
import android.util.LruCache;
import android.util.SparseArray;
import android.view.View;
import java.util.HashSet;
import java.util.Set;

@TargetApi(12)
public class h0 {
    public static SparseArray<String> a;
    public static Set<Integer> b;
    public static LruCache<Class, String> c = new LruCache(100);

    public static String a(View view, boolean z) {
        Object tag = view.getTag(84159242);
        if (tag != null && (tag instanceof String)) {
            return (String) tag;
        }
        if (z) {
            return null;
        }
        if (a == null) {
            a = new SparseArray();
        }
        if (b == null) {
            b = new HashSet();
        }
        int id = view.getId();
        if (id > 2130706432 && !b.contains(Integer.valueOf(id))) {
            String str = (String) a.get(id);
            if (str != null) {
                return str;
            }
            try {
                String resourceEntryName = view.getResources().getResourceEntryName(id);
                a.put(id, resourceEntryName);
                return resourceEntryName;
            } catch (Exception unused) {
                b.add(Integer.valueOf(id));
            }
        }
        return null;
    }

    public static String b(Class cls) {
        String str = (String) c.get(cls);
        if (TextUtils.isEmpty(str)) {
            str = cls.getSimpleName();
            if (TextUtils.isEmpty(str)) {
                str = "Anonymous";
            }
            c.put(cls, str);
            if (!(e0.j || e0.e || e0.a || !str.contains("RecyclerView"))) {
                try {
                    if (!(e0.a(cls) == null || e0.c == null)) {
                        e0.b = cls;
                        e0.a = true;
                    }
                } catch (Exception e) {
                    m0.b(e);
                }
            }
        }
        return str;
    }

    public static String c(String str) {
        if (str == null) {
            return "";
        }
        if (!TextUtils.isEmpty(str) && str.length() > 20) {
            str = str.substring(0, 20);
        }
        return str;
    }

    /* JADX WARNING: Missing block: B:85:0x01a4, code skipped:
            if (r0 != null) goto L_0x01b8;
     */
    /* JADX WARNING: Missing block: B:89:0x01b4, code skipped:
            if (r0 != null) goto L_0x01b8;
     */
    public static java.util.ArrayList<java.lang.String> d(android.view.View r9, java.lang.String r10) {
        /*
        r0 = 84159244; // 0x5042b0c float:6.2145166E-36 double:4.1580191E-316;
        r0 = r9.getTag(r0);
        r1 = 0;
        r2 = 1;
        if (r0 == 0) goto L_0x0011;
    L_0x000b:
        r0 = java.lang.String.valueOf(r0);
        goto L_0x01b8;
    L_0x0011:
        r0 = r9 instanceof android.view.ViewGroup;
        r3 = 0;
        if (r0 == 0) goto L_0x0040;
    L_0x0016:
        r0 = r9;
        r0 = (android.view.ViewGroup) r0;
        r4 = r0.getChildCount();
        r5 = new java.util.ArrayList;
        r5.<init>(r4);
    L_0x0022:
        if (r3 >= r4) goto L_0x003c;
    L_0x0024:
        r6 = r0.getChildAt(r3);
        r6 = r6.getVisibility();
        if (r6 != 0) goto L_0x003c;
    L_0x002e:
        r6 = r0.getChildAt(r3);
        r6 = d(r6, r1);
        r5.addAll(r6);
        r3 = r3 + 1;
        goto L_0x0022;
    L_0x003c:
        r0 = r1;
        r1 = r5;
        goto L_0x01b8;
    L_0x0040:
        r0 = r9 instanceof android.widget.EditText;
        if (r0 == 0) goto L_0x008c;
    L_0x0044:
        r0 = 84159251; // 0x5042b13 float:6.214522E-36 double:4.15801947E-316;
        r0 = r9.getTag(r0);
        if (r0 == 0) goto L_0x01b7;
    L_0x004d:
        r0 = r9;
        r0 = (android.widget.EditText) r0;
        r4 = r0.getInputType();
        r4 = r4 & 4095;
        r5 = 129; // 0x81 float:1.81E-43 double:6.37E-322;
        if (r4 == r5) goto L_0x0066;
    L_0x005a:
        r5 = 225; // 0xe1 float:3.15E-43 double:1.11E-321;
        if (r4 == r5) goto L_0x0066;
    L_0x005e:
        r5 = 18;
        if (r4 == r5) goto L_0x0066;
    L_0x0062:
        r5 = 145; // 0x91 float:2.03E-43 double:7.16E-322;
        if (r4 != r5) goto L_0x0067;
    L_0x0066:
        r3 = 1;
    L_0x0067:
        if (r3 != 0) goto L_0x01b7;
    L_0x0069:
        r3 = android.widget.TextView.class;
        r4 = "mText";
        r3 = r3.getDeclaredField(r4);	 Catch:{ all -> 0x007b }
        r3.setAccessible(r2);	 Catch:{ all -> 0x007b }
        r0 = r3.get(r0);	 Catch:{ all -> 0x007b }
        r0 = (java.lang.CharSequence) r0;	 Catch:{ all -> 0x007b }
        goto L_0x0080;
    L_0x007b:
        r0 = move-exception;
        c.c.a.m0.b(r0);
        r0 = r1;
    L_0x0080:
        if (r0 != 0) goto L_0x0086;
    L_0x0082:
        r0 = "";
        goto L_0x01b8;
    L_0x0086:
        r0 = r0.toString();
        goto L_0x01b8;
    L_0x008c:
        r0 = r9 instanceof android.widget.RatingBar;
        if (r0 == 0) goto L_0x009d;
    L_0x0090:
        r0 = r9;
        r0 = (android.widget.RatingBar) r0;
        r0 = r0.getRating();
        r0 = java.lang.String.valueOf(r0);
        goto L_0x01b8;
    L_0x009d:
        r0 = r9 instanceof android.widget.Spinner;
        if (r0 == 0) goto L_0x00cc;
    L_0x00a1:
        r0 = r9;
        r0 = (android.widget.Spinner) r0;
        r3 = r0.getSelectedItem();
        r4 = r3 instanceof java.lang.String;
        if (r4 == 0) goto L_0x00af;
    L_0x00ac:
        r3 = (java.lang.String) r3;
        goto L_0x00c9;
    L_0x00af:
        r0 = r0.getSelectedView();
        r3 = r0 instanceof android.widget.TextView;
        if (r3 == 0) goto L_0x00c8;
    L_0x00b7:
        r0 = (android.widget.TextView) r0;
        r3 = r0.getText();
        if (r3 == 0) goto L_0x00c8;
    L_0x00bf:
        r0 = r0.getText();
        r3 = r0.toString();
        goto L_0x00c9;
    L_0x00c8:
        r3 = r1;
    L_0x00c9:
        r0 = r3;
        goto L_0x01b8;
    L_0x00cc:
        r0 = r9 instanceof android.widget.SeekBar;
        if (r0 == 0) goto L_0x00dd;
    L_0x00d0:
        r0 = r9;
        r0 = (android.widget.SeekBar) r0;
        r0 = r0.getProgress();
        r0 = java.lang.String.valueOf(r0);
        goto L_0x01b8;
    L_0x00dd:
        r0 = r9 instanceof android.widget.RadioGroup;
        if (r0 == 0) goto L_0x0104;
    L_0x00e1:
        r0 = r9;
        r0 = (android.widget.RadioGroup) r0;
        r3 = r0.getCheckedRadioButtonId();
        r0 = r0.findViewById(r3);
        if (r0 == 0) goto L_0x01b7;
    L_0x00ee:
        r3 = r0 instanceof android.widget.RadioButton;
        if (r3 == 0) goto L_0x01b7;
    L_0x00f2:
        r0 = (android.widget.RadioButton) r0;
        r3 = r0.getText();
        if (r3 == 0) goto L_0x01b7;
    L_0x00fa:
        r0 = r0.getText();
        r0 = r0.toString();
        goto L_0x01b8;
    L_0x0104:
        r0 = r9 instanceof android.widget.TextView;
        if (r0 == 0) goto L_0x011b;
    L_0x0108:
        r0 = r9;
        r0 = (android.widget.TextView) r0;
        r3 = r0.getText();
        if (r3 == 0) goto L_0x01b7;
    L_0x0111:
        r0 = r0.getText();
        r0 = r0.toString();
        goto L_0x01b8;
    L_0x011b:
        r0 = r9 instanceof android.widget.ImageView;
        if (r0 == 0) goto L_0x0128;
    L_0x011f:
        r0 = android.text.TextUtils.isEmpty(r10);
        if (r0 != 0) goto L_0x01b7;
    L_0x0125:
        r0 = r10;
        goto L_0x01b8;
    L_0x0128:
        r0 = r9 instanceof android.webkit.WebView;
        if (r0 == 0) goto L_0x01a7;
    L_0x012c:
        r0 = r9;
        r0 = (android.webkit.WebView) r0;
        r4 = android.webkit.WebView.class;
        r5 = "mProvider";
        r4 = r4.getDeclaredField(r5);	 Catch:{ Exception -> 0x0196 }
        r4.setAccessible(r2);	 Catch:{ Exception -> 0x0196 }
        r4 = r4.get(r0);	 Catch:{ Exception -> 0x0196 }
        r5 = "android.webkit.WebViewClassic";
        r5 = r5.equals(r4);	 Catch:{ Exception -> 0x0196 }
        if (r5 == 0) goto L_0x015b;
    L_0x0146:
        r5 = r4.getClass();	 Catch:{ Exception -> 0x0196 }
        r6 = "mWebViewCore";
        r5 = r5.getDeclaredField(r6);	 Catch:{ Exception -> 0x0196 }
        r5.setAccessible(r2);	 Catch:{ Exception -> 0x0196 }
        r4 = r5.get(r4);	 Catch:{ Exception -> 0x0196 }
        if (r4 != 0) goto L_0x019e;
    L_0x0159:
        r3 = 1;
        goto L_0x019e;
    L_0x015b:
        r5 = r4.getClass();	 Catch:{ Exception -> 0x0196 }
        r6 = "mAwContents";
        r5 = r5.getDeclaredField(r6);	 Catch:{ Exception -> 0x0196 }
        r5.setAccessible(r2);	 Catch:{ Exception -> 0x0196 }
        r4 = r5.get(r4);	 Catch:{ Exception -> 0x0196 }
        r5 = r4.getClass();	 Catch:{ Exception -> 0x0196 }
        r6 = "isDestroyed";
        r7 = new java.lang.Class[r2];	 Catch:{ Exception -> 0x0196 }
        r8 = java.lang.Integer.TYPE;	 Catch:{ Exception -> 0x0196 }
        r7[r3] = r8;	 Catch:{ Exception -> 0x0196 }
        r5 = r5.getDeclaredMethod(r6, r7);	 Catch:{ Exception -> 0x0196 }
        r5.setAccessible(r2);	 Catch:{ Exception -> 0x0196 }
        r6 = new java.lang.Object[r2];	 Catch:{ Exception -> 0x0196 }
        r7 = java.lang.Integer.valueOf(r3);	 Catch:{ Exception -> 0x0196 }
        r6[r3] = r7;	 Catch:{ Exception -> 0x0196 }
        r4 = r5.invoke(r4, r6);	 Catch:{ Exception -> 0x0196 }
        r5 = r4 instanceof java.lang.Boolean;	 Catch:{ Exception -> 0x0196 }
        if (r5 == 0) goto L_0x019e;
    L_0x018f:
        r4 = (java.lang.Boolean) r4;	 Catch:{ Exception -> 0x0196 }
        r3 = r4.booleanValue();	 Catch:{ Exception -> 0x0196 }
        goto L_0x019e;
    L_0x0196:
        r4 = move-exception;
        r5 = "TeaLog";
        r6 = "isDestroyed(): ";
        android.util.Log.e(r5, r6, r4);
    L_0x019e:
        if (r3 != 0) goto L_0x01a7;
    L_0x01a0:
        r0 = r0.getUrl();
        if (r0 == 0) goto L_0x01b7;
    L_0x01a6:
        goto L_0x01b8;
    L_0x01a7:
        r0 = c.c.a.e0.g(r9);
        if (r0 == 0) goto L_0x01b7;
    L_0x01ad:
        r0 = r9;
        r0 = (com.tencent.smtt.sdk.WebView) r0;
        r0 = r0.getUrl();
        if (r0 == 0) goto L_0x01b7;
    L_0x01b6:
        goto L_0x01b8;
    L_0x01b7:
        r0 = r1;
    L_0x01b8:
        if (r1 != 0) goto L_0x01e5;
    L_0x01ba:
        r1 = android.text.TextUtils.isEmpty(r0);
        if (r1 == 0) goto L_0x01d7;
    L_0x01c0:
        if (r10 == 0) goto L_0x01c3;
    L_0x01c2:
        goto L_0x01d3;
    L_0x01c3:
        r10 = r9.getContentDescription();
        if (r10 == 0) goto L_0x01d2;
    L_0x01c9:
        r9 = r9.getContentDescription();
        r10 = r9.toString();
        goto L_0x01d3;
    L_0x01d2:
        r10 = r0;
    L_0x01d3:
        r0 = c(r10);
    L_0x01d7:
        r1 = new java.util.ArrayList;
        r1.<init>(r2);
        r9 = android.text.TextUtils.isEmpty(r0);
        if (r9 != 0) goto L_0x01e5;
    L_0x01e2:
        r1.add(r0);
    L_0x01e5:
        return r1;
        */
        throw new UnsupportedOperationException("Method not decompiled: c.c.a.h0.d(android.view.View, java.lang.String):java.util.ArrayList");
    }
}
